-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show settings path in --show-settings
output
#4199
Show settings path in --show-settings
output
#4199
Conversation
a3ce92d
to
b264067
Compare
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinux
Windows
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me. I personally would prefer to store the path on the PyprojectDiscovery
rather than the AllSettings
because the path
isn't a setting. But that likely results in a larger change because it requires re-modelling PyprojectDiscovery
:
struct PyprojectDiscovery {
strategy: PyprojectDiscoveryStrategy,
root_settings: AllSettings,
root_settings_path: Option<PathBuf>
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
enum PyprojectDiscoveryStrategy {
Fixed,
Hierarchical
}
What's your take on this?
Could you add a test plan to the PR summary showing the new output?
This is a much better idea. At first I thought to add it as an additional element to the tuple itself but I think a struct is a better option for the long term.
Yes, will add it. I'll make both the changes in the evening. |
81516d8
to
67dba18
Compare
67dba18
to
14e880b
Compare
I've updated the code and PR description :) I'm getting |
I experienced this in the past too when using |
I think this is related: rust-lang/rust#46016 |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://togithub.com/charliermarsh/ruff) | `^0.0.264` -> `^0.0.265` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/compatibility-slim/0.0.264)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/confidence-slim/0.0.264)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.265`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.265) [Compare Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.264...v0.0.265) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### Breaking Changes - Change `--fix-only` exit semantics to mirror `--fix` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4146](https://togithub.com/charliermarsh/ruff/pull/4146) ##### Rules - \[flake8-pyi] PYI020 by [@​arya-k](https://togithub.com/arya-k) in [https://github.com/charliermarsh/ruff/pull/4211](https://togithub.com/charliermarsh/ruff/pull/4211) - Update B027 to support autofixing by [@​aacunningham](https://togithub.com/aacunningham) in [https://github.com/charliermarsh/ruff/pull/4178](https://togithub.com/charliermarsh/ruff/pull/4178) - \[`flake8-pyi`] Implement `PYI042` and `PYI043` by [@​arya-k](https://togithub.com/arya-k) in [https://github.com/charliermarsh/ruff/pull/4214](https://togithub.com/charliermarsh/ruff/pull/4214) - \[`pylint`] Implement import-self (`W0406`) by [@​chanman3388](https://togithub.com/chanman3388) in [https://github.com/charliermarsh/ruff/pull/4154](https://togithub.com/charliermarsh/ruff/pull/4154) - Warn on PEP 604 syntax not in an annotation, but don't autofix by [@​wookie184](https://togithub.com/wookie184) in [https://github.com/charliermarsh/ruff/pull/4170](https://togithub.com/charliermarsh/ruff/pull/4170) ##### Bug Fixes - Fix panic in pydocstyle D214 when docstring indentation is empty by [@​madkinsz](https://togithub.com/madkinsz) in [https://github.com/charliermarsh/ruff/pull/4216](https://togithub.com/charliermarsh/ruff/pull/4216) - Render tabs as 4 spaces in diagnostics by [@​MichaReiser](https://togithub.com/MichaReiser) in [https://github.com/charliermarsh/ruff/pull/4132](https://togithub.com/charliermarsh/ruff/pull/4132) - Fix era panic caused by out of bound edition by [@​leiserfg](https://togithub.com/leiserfg) in [https://github.com/charliermarsh/ruff/pull/4206](https://togithub.com/charliermarsh/ruff/pull/4206) - End of statement insertion should occur after newline by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4215](https://togithub.com/charliermarsh/ruff/pull/4215) - Ignore **debuggerskip** in unused variable checks by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4229](https://togithub.com/charliermarsh/ruff/pull/4229) ##### CLI - Show settings path in `--show-settings` output by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4199](https://togithub.com/charliermarsh/ruff/pull/4199) ##### Documentation - Allow linking to individual rules by [@​calumy](https://togithub.com/calumy) in [https://github.com/charliermarsh/ruff/pull/4158](https://togithub.com/charliermarsh/ruff/pull/4158) #### New Contributors - [@​wookie184](https://togithub.com/wookie184) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4170](https://togithub.com/charliermarsh/ruff/pull/4170) - [@​arya-k](https://togithub.com/arya-k) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4211](https://togithub.com/charliermarsh/ruff/pull/4211) **Full Changelog**: astral-sh/ruff@v0.0.264...v0.0.265 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/ixm-one/pytest-cmake-presets). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS43MS40IiwidXBkYXRlZEluVmVyIjoiMzUuNzEuNCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Signed-off-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://togithub.com/charliermarsh/ruff) | `==0.0.264` -> `==0.0.265` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/compatibility-slim/0.0.264)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/confidence-slim/0.0.264)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.265`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.265) [Compare Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.264...v0.0.265) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### Breaking Changes - Change `--fix-only` exit semantics to mirror `--fix` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4146](https://togithub.com/charliermarsh/ruff/pull/4146) ##### Rules - \[flake8-pyi] PYI020 by [@​arya-k](https://togithub.com/arya-k) in [https://github.com/charliermarsh/ruff/pull/4211](https://togithub.com/charliermarsh/ruff/pull/4211) - Update B027 to support autofixing by [@​aacunningham](https://togithub.com/aacunningham) in [https://github.com/charliermarsh/ruff/pull/4178](https://togithub.com/charliermarsh/ruff/pull/4178) - \[`flake8-pyi`] Implement `PYI042` and `PYI043` by [@​arya-k](https://togithub.com/arya-k) in [https://github.com/charliermarsh/ruff/pull/4214](https://togithub.com/charliermarsh/ruff/pull/4214) - \[`pylint`] Implement import-self (`W0406`) by [@​chanman3388](https://togithub.com/chanman3388) in [https://github.com/charliermarsh/ruff/pull/4154](https://togithub.com/charliermarsh/ruff/pull/4154) - Warn on PEP 604 syntax not in an annotation, but don't autofix by [@​wookie184](https://togithub.com/wookie184) in [https://github.com/charliermarsh/ruff/pull/4170](https://togithub.com/charliermarsh/ruff/pull/4170) ##### Bug Fixes - Fix panic in pydocstyle D214 when docstring indentation is empty by [@​madkinsz](https://togithub.com/madkinsz) in [https://github.com/charliermarsh/ruff/pull/4216](https://togithub.com/charliermarsh/ruff/pull/4216) - Render tabs as 4 spaces in diagnostics by [@​MichaReiser](https://togithub.com/MichaReiser) in [https://github.com/charliermarsh/ruff/pull/4132](https://togithub.com/charliermarsh/ruff/pull/4132) - Fix era panic caused by out of bound edition by [@​leiserfg](https://togithub.com/leiserfg) in [https://github.com/charliermarsh/ruff/pull/4206](https://togithub.com/charliermarsh/ruff/pull/4206) - End of statement insertion should occur after newline by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4215](https://togithub.com/charliermarsh/ruff/pull/4215) - Ignore **debuggerskip** in unused variable checks by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4229](https://togithub.com/charliermarsh/ruff/pull/4229) ##### CLI - Show settings path in `--show-settings` output by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4199](https://togithub.com/charliermarsh/ruff/pull/4199) ##### Documentation - Allow linking to individual rules by [@​calumy](https://togithub.com/calumy) in [https://github.com/charliermarsh/ruff/pull/4158](https://togithub.com/charliermarsh/ruff/pull/4158) #### New Contributors - [@​wookie184](https://togithub.com/wookie184) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4170](https://togithub.com/charliermarsh/ruff/pull/4170) - [@​arya-k](https://togithub.com/arya-k) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4211](https://togithub.com/charliermarsh/ruff/pull/4211) **Full Changelog**: astral-sh/ruff@v0.0.264...v0.0.265 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/allenporter/flux-local). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS43MS40IiwidXBkYXRlZEluVmVyIjoiMzUuNzEuNCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://togithub.com/charliermarsh/ruff) | `==0.0.264` -> `==0.0.265` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/compatibility-slim/0.0.264)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/confidence-slim/0.0.264)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.265`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.265) [Compare Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.264...v0.0.265) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### Breaking Changes - Change `--fix-only` exit semantics to mirror `--fix` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4146](https://togithub.com/charliermarsh/ruff/pull/4146) ##### Rules - \[flake8-pyi] PYI020 by [@​arya-k](https://togithub.com/arya-k) in [https://github.com/charliermarsh/ruff/pull/4211](https://togithub.com/charliermarsh/ruff/pull/4211) - Update B027 to support autofixing by [@​aacunningham](https://togithub.com/aacunningham) in [https://github.com/charliermarsh/ruff/pull/4178](https://togithub.com/charliermarsh/ruff/pull/4178) - \[`flake8-pyi`] Implement `PYI042` and `PYI043` by [@​arya-k](https://togithub.com/arya-k) in [https://github.com/charliermarsh/ruff/pull/4214](https://togithub.com/charliermarsh/ruff/pull/4214) - \[`pylint`] Implement import-self (`W0406`) by [@​chanman3388](https://togithub.com/chanman3388) in [https://github.com/charliermarsh/ruff/pull/4154](https://togithub.com/charliermarsh/ruff/pull/4154) - Warn on PEP 604 syntax not in an annotation, but don't autofix by [@​wookie184](https://togithub.com/wookie184) in [https://github.com/charliermarsh/ruff/pull/4170](https://togithub.com/charliermarsh/ruff/pull/4170) ##### Bug Fixes - Fix panic in pydocstyle D214 when docstring indentation is empty by [@​madkinsz](https://togithub.com/madkinsz) in [https://github.com/charliermarsh/ruff/pull/4216](https://togithub.com/charliermarsh/ruff/pull/4216) - Render tabs as 4 spaces in diagnostics by [@​MichaReiser](https://togithub.com/MichaReiser) in [https://github.com/charliermarsh/ruff/pull/4132](https://togithub.com/charliermarsh/ruff/pull/4132) - Fix era panic caused by out of bound edition by [@​leiserfg](https://togithub.com/leiserfg) in [https://github.com/charliermarsh/ruff/pull/4206](https://togithub.com/charliermarsh/ruff/pull/4206) - End of statement insertion should occur after newline by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4215](https://togithub.com/charliermarsh/ruff/pull/4215) - Ignore **debuggerskip** in unused variable checks by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/4229](https://togithub.com/charliermarsh/ruff/pull/4229) ##### CLI - Show settings path in `--show-settings` output by [@​dhruvmanila](https://togithub.com/dhruvmanila) in [https://github.com/charliermarsh/ruff/pull/4199](https://togithub.com/charliermarsh/ruff/pull/4199) ##### Documentation - Allow linking to individual rules by [@​calumy](https://togithub.com/calumy) in [https://github.com/charliermarsh/ruff/pull/4158](https://togithub.com/charliermarsh/ruff/pull/4158) #### New Contributors - [@​wookie184](https://togithub.com/wookie184) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4170](https://togithub.com/charliermarsh/ruff/pull/4170) - [@​arya-k](https://togithub.com/arya-k) made their first contribution in [https://github.com/charliermarsh/ruff/pull/4211](https://togithub.com/charliermarsh/ruff/pull/4211) **Full Changelog**: astral-sh/ruff@v0.0.264...v0.0.265 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/allenporter/pyrainbird). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS43MS40IiwidXBkYXRlZEluVmVyIjoiMzUuNzEuNCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Summary
Create a new struct called
PyprojectConfig
which holds all thepyproject.toml
configuration related information. This includes the discovery strategy used (Fixed
orHierarchical
), the settings itself and absolute path to thepyproject.toml
file.Using
PyprojectConfig::new
will try to resolve the given config path to absolute.Test Plan
Project structure:
Using `--isolated` (no config path):
Using
--config pyproject.toml
Using
--config ../pyproject.toml
Using hierarchical strategy to find config file
No config file (commented out
[tool.ruff]
section)resolves: #3202